package org.l.mybatis.core.sqlsource;

import java.lang.reflect.Method;

import org.apache.ibatis.session.Configuration;
import org.l.mybatis.core.annotation.SqlsourceDelete;
import org.l.mybatis.core.annotation.SqlsourceInsert;
import org.l.mybatis.core.annotation.SqlsourceSelect;
import org.l.mybatis.core.annotation.SqlsourceUpdate;
import org.l.mybatis.core.exception.MethodDefineException;

/**
* @author 阿旺
* @version 2017年11月1日 上午11:43:50
*/
public class DefaultSqlsourceBuilderFactory implements SqlsourceBuilderFactory{

    @Override
    public SqlsourceBuilder createSelect(Configuration configuration, Class<?> type, Method method,
            SqlsourceSelect sqlsourceSelect) throws MethodDefineException {
        return new SqlsourceBuilderSelect(configuration, type, method, sqlsourceSelect);
    }

    @Override
    public SqlsourceBuilder createInsert(Configuration configuration, Class<?> type, Method method,
            SqlsourceInsert sqlsourceInsert) throws MethodDefineException {
        return new SqlsourceBuilderInsert(configuration, type, method, sqlsourceInsert);
    }

    @Override
    public SqlsourceBuilder createUpdate(Configuration configuration, Class<?> type, Method method,
            SqlsourceUpdate sqlsourceUpdate) throws MethodDefineException {
        return new SqlsourceBuilderUpdate(configuration, type, method, sqlsourceUpdate);
    }

    @Override
    public SqlsourceBuilder createDelete(Configuration configuration, Class<?> type, Method method,
            SqlsourceDelete sqlsourceDelete) throws MethodDefineException {
        return new SqlsourceBuilderDelete(configuration, type, method, sqlsourceDelete);
    }
    
}
